.de IQ
.  br
.  ns
.  IP "\\$1"
..
.TH ovs\-test 1 "2.5.0" "Open vSwitch" "Open vSwitch Manual"
.
.SH NAME
\fBovs\-test\fR \- check Linux drivers for performance, vlan and L3 tunneling
problems
.
.SH SYNOPSIS
\fBovs\-test\fR \fB\-s\fR \fIport\fR
.PP
\fBovs\-test\fR \fB\-c\fR \fIserver1\fR \fIserver2\fR
[\fB\-b\fR \fItargetbandwidth\fR] [\fB\-i\fR \fItestinterval\fR]
[\fB\-d\fR]
[\fB\-l\fR \fIvlantag\fR]
[\fB\-t\fR \fItunnelmodes\fR]
.IP "Common options:"
[\fB\-h\fR | \fB\-\-help\fR]
[\fB\-V\fR | \fB\-\-version\fR]

.
.SH DESCRIPTION
The \fBovs\-test\fR program may be used to check for problems sending
802.1Q or GRE traffic that Open vSwitch may uncover. These problems,
for example, can occur when Open vSwitch is used to send 802.1Q traffic
through physical interfaces running certain drivers of certain Linux kernel
versions. To run a test, configure IP addresses on \fIserver1\fR and
\fIserver2\fR for interfaces you intended to test. These interfaces could
also be already configured OVS bridges that have a physical interface attached
to them. Then, on one of the nodes, run \fBovs\-test\fR in server mode and on
the other node run it in client mode. The client will connect to
\fBovs\-test\fR server and schedule tests between both of them. The
\fBovs\-test\fR client will perform UDP and TCP tests.
.PP
UDP tests can report packet loss and achieved bandwidth for various
datagram sizes. By default target bandwidth for UDP tests is 1Mbit/s.
.PP
TCP tests report only achieved bandwidth, because kernel TCP stack
takes care of flow control and packet loss. TCP tests are essential to detect
potential TSO related issues.
.PP
To determine whether Open vSwitch is encountering any problems,
the user must compare packet loss and achieved bandwidth in a setup where
traffic is being directly sent and in one where it is not. If in the
802.1Q or L3 tunneled tests both \fBovs\-test\fR processes are unable to
communicate or the achieved bandwidth is much lower compared to direct setup,
then, most likely, Open vSwitch has encountered a pre-existing kernel or
driver bug.
.PP
Some examples of the types of problems that may be encountered are:
.IP \(bu
When NICs use VLAN stripping on receive they must pass a pointer to a
\fBvlan_group\fR when reporting the stripped tag to the networking
core.  If no \fBvlan_group\fR is in use then some drivers just drop
the extracted tag.  Drivers are supposed to only enable stripping if a
\fBvlan_group\fR is registered but not all of them do that.
.
.IP \(bu
On receive, some drivers handle priority tagged packets specially and
don't pass the tag onto the network stack at all, so Open vSwitch
never has a chance to see it.
.
.IP \(bu
Some drivers size their receive buffers based on whether a
\fBvlan_group\fR is enabled, meaning that a maximum size packet with a
VLAN tag will not fit if no \fBvlan_group\fR is configured.
.
.IP \(bu
On transmit, some drivers expect that VLAN acceleration will be used
if it is available, which can only be done if a \fBvlan_group\fR is
configured.  In these cases, the driver may fail to parse the packet
and correctly setup checksum offloading or TSO.
.
.SS "Client Mode"
An \fBovs\-test\fR client will connect to two \fBovs\-test\fR servers and
will ask them to exchange test traffic. It is also possible to spawn an
\fBovs\-test\fR server automatically from the client.
.
.SS "Server Mode"
To conduct tests, two \fBovs\-test\fR servers must be running on two different
hosts where the client can connect. The actual test traffic is exchanged only
between both \fBovs\-test\fR servers. It is recommended that both servers have
their IP addresses in the same subnet, otherwise one would have to make sure
that routing is set up correctly.
.
.SH OPTIONS
.
.IP "\fB\-s \fIport\fR"
.IQ "\fB\-\-server\fR \fIport\fR"
Run in server mode and wait for the client to establish XML RPC Control
Connection on this TCP \fIport\fR. It is recommended to have \fBethtool\fR(8)
installed on the server so that it could retrieve information about the NIC
driver.
.
.IP "\fB\-c \fIserver1\fR \fIserver2\fR"
.IQ "\fB\-\-client \fIserver1\fR \fIserver2\fR"
Run in client mode and schedule tests between \fIserver1\fR and \fIserver2\fR,
where each \fIserver\fR must be given in the following format -
\fIOuterIP[:OuterPort],InnerIP[/Mask][:InnerPort]\fR. The \fIOuterIP\fR must
be already assigned to the physical interface which is going to be tested.
This is the IP address where client will try to establish XML RPC connection.
If \fIOuterIP\fR is 127.0.0.1 then client will automatically spawn a local
instance of \fBovs\-test\fR server. \fIOuterPort\fR is TCP port where server
is listening for incoming XML/RPC control connections to schedule tests (by
default it is 15531). The \fBovs\-test\fR will automatically assign
\fIInnerIP[/Mask]\fR to the interfaces that will be created on the fly for
testing purposes. It is important that \fIInnerIP[/Mask]\fR does not interfere
with already existing IP addresses on both \fBovs\-test\fR servers and client.
\fIInnerPort\fR is port which will be used by server to listen for test
traffic that will be encapsulated (by default it is 15532).
.
.IP "\fB\-b \fItargetbandwidth\fR"
.IQ "\fB\-\-bandwidth\fR \fItargetbandwidth\fR"
Target bandwidth for UDP tests. The \fItargetbandwidth\fR must be given in
bits per second. It is possible to use postfix M or K to alter the target
bandwidth magnitude.
.
.IP "\fB\-i \fItestinterval\fR"
.IQ "\fB\-\-interval\fR \fItestinterval\fR"
How long each test should run. By default 5 seconds.
.
.de IQ
.  br
.  ns
.  IP "\\$1"
..
.IP "\fB\-h\fR"
.IQ "\fB\-\-help\fR"
Prints a brief help message to the console.
.
.IP "\fB\-V\fR"
.IQ "\fB\-\-version\fR"
Prints version information to the console.
.
.SH "Test Modes"
The following test modes are supported by \fBovs\-test\fR. It is possible
to combine multiple of them in a single \fBovs\-test\fR invocation.
.
.IP "\fB\-d \fR"
.IQ "\fB\-\-direct\fR"
Perform direct tests between both \fIOuterIP\fR addresses. These tests could
be used as a reference to compare 802.1Q or L3 tunneling test results.
.
.IP "\fB\-l \fIvlantag\fR"
.IQ "\fB\-\-vlan\-tag\fR \fIvlantag\fR"
Perform 802.1Q tests between both servers. These tests will create a temporary
OVS bridge, if necessary, and attach a VLAN tagged port to it for testing
purposes.
.
.IP "\fB\-t \fItunnelmodes\fR"
.IQ "\fB\-\-tunnel\-modes\fR \fItunnelmodes\fR"
Perform L3 tunneling tests. The given argument is a comma separated string
that specifies all the L3 tunnel modes that should be tested (e.g. gre). The L3
tunnels are terminated on interface that has the \fIOuterIP\fR address
assigned.
.
.SH EXAMPLES
.PP
On host 1.2.3.4 start \fBovs\-test\fR in server mode:
.IP
.B ovs\-test \-s 15531
.
.PP
On host 1.2.3.5 start \fBovs\-test\fR in client mode and do direct, VLAN and
GRE tests between both nodes:
.IP
.B ovs\-test \-c 127.0.0.1,1.1.1.1/30 1.2.3.4,1.1.1.2/30 -d -l 123 -t gre
.
.SH SEE ALSO
.
.BR ovs\-vswitchd (8),
.BR ovs\-ofctl (8),
.BR ovs\-vsctl (8),
.BR ovs\-vlan\-test (8),
.BR ethtool (8),
.BR uname (1)
